import { reqSearchList } from '@/api/search'
import type { ISearchParams, ISearchlist } from '@/types/search'
import { defineStore } from 'pinia'

export const useSearchStore = defineStore('searchStore', {
  //定义数据
  state(){
    return {
        goods:{} as ISearchlist
    }
  },
  //修改数据
  actions: {
    async getSearchList(params:ISearchParams) {
        const res=await reqSearchList(params)
        // console.log(res)
        if(res.code==200){
            this.goods=res.data
        }
    }
  }
})
